﻿using System;

namespace BasicSeries002
{
    class Program
    {
        public delegate void DelegateTest(int i);
        static void Main(string[] args)
        {
            var dtstatic = new DelegateTest(Program.method1);

            var dtinstance = new DelegateTest(new Program().method2);

            dtstatic(1);

            dtinstance(2);

            Console.ReadKey();
        }

        private static void method1(int i)
        {
            Console.WriteLine("调用的是静态方法，参数值是" + i);
        }

        private void method2(int i)
        {
            Console.WriteLine("调用的是实例方法，参数值是" + i);
        }
    }
}
